#include "controls/expandgroupbox/cxiexpandgroupbox.h"

CxiExpandGroupBox::CxiExpandGroupBox(QWidget* parent) : QGroupBox(parent)
{
	setCheckable(true);

	// 绑定展开状态
	connect(this, &QGroupBox::toggled, [this](bool checked) {
		setFlat(!checked);
		for (auto child: findChildren<QWidget*>(QString(), Qt::FindDirectChildrenOnly))
		{
			child->setVisible(checked);
		}
	});
}
